//
//  Helpers.swift
//  RxObjectDemo
//
//  Created by CaryaLiu on 2021/2/23.
//

import RxCocoa

func castOrThrow<T>(_ resultType: T.Type, _ object: Any) throws -> T {
    guard let returnValue = object as? T else {
        throw RxCocoaError.castingError(object: object, targetType: resultType)
    }
    return returnValue
}
